<div class="modal-header">
    <h4 class="modal-title">{{item._id?'编辑':'添加'}}实例</h4>
</div>
<div class="modal-body container-fluid form-horizontal">
    <form name="form" novalidate>
    <div class="form-group">
        <label class="col-xs-4 control-label required">实例名称：</label>
        <div class="col-xs-6">
            <input type="text" class="form-control" ng-model="item.name" name="name" required/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-4 control-label required">场景：</label>
        <div class="col-xs-6">
            <input type="text" ng-model="item.scene" placeholder="--场景--" typeahead-on-select="getDefinedParams(item.scene)"
                   uib-typeahead="o as o.name for o in findScene($viewValue)"
                   class="form-control"  typeahead-show-hint="true" typeahead-min-length="0" required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-4 control-label">参数(默认值)：</label>
    </div>
        <div class="form-group"  ng-repeat="param in item.params track by $index"  >
            <label class="col-xs-4 control-label">{{param.key}}：</label>
            <div class="col-xs-6" >
                <input type="text" ng-model="param.value" placeholder="--支持动态日期--"
                       uib-typeahead="o.code as o.code+' ('+o.value+') ' for o in $root.dateDict"
                       class="form-control"  typeahead-show-hint="true" typeahead-min-length="0" >
            </div>
            <!--<div class="col-xs-4" >
                <select class="form-control" ng-model="param.date" ng-options="o.code as o.text for o in dateDict" >
                    <option value="">&#45;&#45;请选择&#45;&#45;</option>
                </select>
            </div>-->
        </div>
    </form>
</div>
<div class="modal-footer">
    <button class="btn btn-primary" ng-click="save(form,item)">确定</button>
    <button class="btn btn-warning" ng-click="$dismiss()">取消</button>
</div>


